package com.weixin.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.weixin.bean.Student;
import com.weixin.mapper.StudentMapper;
import com.weixin.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService{

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public List<Student> selectAll(int pageNumber,int pageSize) {
        PageHelper.startPage(pageNumber, pageSize);
        return studentMapper.selectByExample(null);
    }

    @Override
    public List<Student> selectStudentWidthClassRoom(int pageNumber, int pageSize) {
        return null;
    }

    @Override
    public int deleteByPrimaryKey(int primayKey) {
        return studentMapper.deleteByPrimaryKey(primayKey);
    }

    @Override
    public Student selectByPrimaryKey(int primayKey) {
        return studentMapper.selectByPrimaryKey(primayKey);
    }
}
